package com.qf.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 测试配置中心
 * @author lixu
 */
@RestController
@RequestMapping("/config")
@RefreshScope
public class TestConfigController {

    @Value("${version}")
    private String version;

    @Value("${redis.host}")
    private String redisHost;
    @Value("${redis.port}")
    private String redisPort;
    @Value("${redis.password}")
    private String redisPassword;

    @GetMapping("/version")
    public String version(){

        return "我是提供者微服务：结果是：" + version;
    }
    @GetMapping("/ext")
    public String ext(){

        return "我是提供者微服务：结果是：" + redisHost+","+redisPort+","+redisPassword;
    }
}
